<!DOCTYPE HTML>
<html lang="zh-CN" data-rem="375">
<head>
    <meta charset="UTF-8">
    <title>创业资讯</title>
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <meta name="apple-mobile-web-app-capable" content="no" />
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" type="text/css" href="/css/style-news.css" />

</head>
<body>
<div class="page-top">
    <div class="page-nav">
        <span class="page-nav-title">创业资讯</span>
        <a href="{{route('search')}}">
            <img src="/img/common/search-icon-black.png" alt="" class="nav-search">
        </a>
    </div>

    <div class="page-tabs-sec">
        <ul class="tabs">
            @foreach($news_type_list as $key => $item)
                <li class="tab-item @if($item->id == $news_type) tab-item-active @endif "><a href="{{route('h5.news.list', ['news_type' => $item->id])}}">{{$item->value}}</a></li>
            @endforeach
        </ul>
    </div>
</div>

<div class="page-content">
    <div id="ajaxTabContent">
        <div class="news-list">
            @foreach($new_list['list'] as $item)
                <a href="{{route('news.info', ['id' => $item->id])}}">
                    <div class="news-item">
                        <div class="news-title one-line">{{$item->name}}</div>
                        <div class="news-date"><span class="date">{{date('Y-m-d', strtotime($item->updated_at))}}</span> <span class="time">{{date('H:i:s', strtotime($item->updated_at))}}</span></div>
                        <img src="/img/common/arrow-right.png" alt="" class="arrow-right">
                    </div>
                </a>
            @endforeach
        </div>
    </div>
    <span class="hasMore">加载更多</span>
</div>



<div class="page-footer">
    <div class="footer-item">
        <img src="/img/tabbar/tabbar-home-active.png" width="27px" height="24px" alt="" class="footer-img">
        <span class="footer-txt">首页</span>
    </div>
    <div class="footer-item">
        <img src="/img/tabbar/tabbar-home-active.png" width="27px" height="24px" alt="" class="footer-img">
        <span class="footer-txt">项目部</span>
    </div>
    <div class="footer-item">
        <img src="/img/tabbar/tabbar-home-active.png" width="27px" height="24px" alt="" class="footer-img">
        <span class="footer-txt">创业资讯</span>
    </div>
    <div class="footer-item">
        <img src="/img/tabbar/tabbar-home-active.png" width="27px" height="24px" alt="" class="footer-img">
        <span class="footer-txt">排行榜</span>
    </div>

</div>



<script crossorigin="anonymous" integrity="sha384-qu2J8HSjv8EaYlbzBdbVeJncuCmfBqnZ4h3UIBZ9WTZ/5Wrqt0/9hofL0046NCkc" src="https://lib.baomitu.com/zepto/1.2.0/zepto.min.js"></script>
<script src="/js/utils.js"></script>
<script>

    $(function () {
        var currentPage = 1;

        utils.initFooter()

        $(".hasMore").click(function () {
            $.get("{{route('h5.ajax.news.list', [ 'news_type' => $news_type ?? 0])}}", {page: (currentPage+1)}, function (result) {
                currentPage = parseInt($(result).find(".currentPage").val());
                has_more_page = $(result).find(".has_more_page").val();
                $("#ajaxTabContent").append(result);
                if (!has_more_page)
                    $(".hasMore").hide();
            });
        });
    })
</script>
</body>
</html>